﻿using System;
using System.Collections.Generic;
using System.Text;

namespace X3DLib
{
    public class _Cone:Gemeotry
    {
        private string Bottom;

        public string bottom
        {
            get { return Bottom; }
            set { Bottom = value; }
        }
        private string BottomRadius;

        public string bottomRadius
        {
            get { return BottomRadius; }
            set { BottomRadius = value; }
        }
        private string Height;

        public string height
        {
            get { return Height; }
            set { Height = value; }
        }
        private string Side;

        public string side
        {
            get { return Side; }
            set { Side = value; }
        }
        private string Solid;

        public string solid
        {
            get { return Solid; }
            set { Solid = value; }
        }

        public _Cone()
        {

        }
        public override string getAttrs()
        {
            return "DEF|" + this.DEF + "|string,"
                    + "USE|" + this.USE + "|string,"
                    + "bottom|" + (this.bottom == null ? "true" : "false") + "|bool,"
                    + "bottomRadius|" + (this.bottomRadius == null ? "1" : this.bottomRadius) + "|float,"
                    + "height|" + (this.height == null ? "2" : this.height) + "|float,"
                    + "side|" + (this.side == null ? "true" : "false") + "|bool,"
                    + "solid|" + (this.solid == null ? "true" : "false") + "|bool";
        }
        public override void setAttrs(string attrs)
        {
            string[][] temp = X3DString.getArrayByAttrs(attrs);
            for (int i = 0; i < temp.Length; i++)
            {
                switch (temp[i][0])
                {
                    case "DEF":
                        this.DEF = temp[i][1];
                        break;
                    case "USE":
                        this.USE = temp[i][1];
                        break;
                    case "bottom":
                        this.bottom = temp[i][1];
                        break;
                    case "bottomRadius":
                        this.bottomRadius = temp[i][1];
                        break;
                    case "height":
                        this.height = temp[i][1];
                        break;
                    case "side":
                        this.side = temp[i][1];
                        break;
                    case "solied":
                        this.solid = temp[i][1];
                        break;
                }
            }
        }
    }
}
